#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char* argv[]) {
	char buffer[128];
	int length;
	int errors;
	int i;
	
	printf("Give me a word, and I'll tell you when it's a palindrome!");
	gets(buffer);
	length = strlen(buffer);
	
	printf("Word '%s', length: %d\n", buffer, length);
	
	errors = 0;
	for (i = 0; i < length / 2; i++) {
		errors += (buffer[i]!=buffer[length-i-1]);
	}
	
	if (errors==0) {
		printf("Hey, that was a palindrome!\n");
	} else {
		printf("Errors: %d\n", errors);
	}
	
	return 0;
}
